package com.xasz.text2vec.utils;

import com.xasz.text2vec.dao.entity.KnowledgeBase;
import com.xasz.text2vec.dao.entity.Summary;
import com.xasz.text2vec.dto.KnowledgeDTO;
import com.xasz.text2vec.dto.SummaryDTO;

/**
 * @author me
 */
public final class ToPo {
    public static Summary SummaryToPo(SummaryDTO dto) {
        Summary summary=new Summary();
        summary.setId(dto.getId());
        summary.setName(dto.getName());
        summary.setSysCode(dto.getSysCode());
        summary.setEmail(dto.getEmail());
        summary.setPhone(dto.getPhone());
        summary.setStatus(dto.getStatus());
        return summary;
    }

    public static KnowledgeBase KnowledgeToPo(KnowledgeDTO dto) {
        KnowledgeBase knowledgeBase=new KnowledgeBase();
        knowledgeBase.setId(dto.getId());
        knowledgeBase.setTitle(dto.getTitle());
        knowledgeBase.setContent(dto.getContent());
        knowledgeBase.setSysCode(dto.getSysCode());
        return  knowledgeBase;
    }
}
